package com.fengye.security.domain.dto;

import com.fengye.security.validation.annotation.PasswordMatch;
import com.fengye.security.validation.annotation.ValidEmail;
import com.fengye.security.validation.annotation.ValidPassword;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @author fengyexjtu@126.com
 * @date 2022年04月13日 11:02 AM
 */
@PasswordMatch
@Data
public class UserDto implements Serializable {

    @NotNull
    @NotBlank
    @Size(min = 4, max = 50, message = "用户名长度必须在 4 到 50 个字符之间")
    private String username;

    @NotNull
    @ValidPassword
    private String password;

    @NotNull
    private String matchingPassword;

    @NotNull
    @ValidEmail
    private String email;

    @NotNull
    @NotBlank
    @Size(min = 4, max = 50, message = "姓名必须在 4 到 50 个字符之间")
    private String name;
}
